<?php get_header(); ?>

<!--当前位置-->

<div class="crumb"><a href="/">首页</a> &gt; <span><?php echo '<span style="color: #cc0000">'.$s.'</span> 的搜索结果'; ?></span></div>

<!--当前位置 End-->

<!--Container-->
<div id="container">
	<!--Content-->
	<div id="content">
		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
		<?php
		$title = get_the_title();
		$excerpt = mb_strimwidth(strip_tags(apply_filters('the_excerpt', $post->post_content)), 0, 250,"......");
		$keys = explode(" ",$s);
		$title = preg_replace('/('.implode('|', $keys) .')/iu','<span style="color: #cc0000">\0</span>',$title);
		$excerpt = preg_replace('/('.implode('|', $keys) .')/iu','<span style="color: #cc0000">\0</span>',$excerpt);
		?>	
		<!--content_text-->
		<div class="content_text">
			<div class="title">
				<a href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>" class="avatar">
					<?php echo get_avatar( get_the_author_email(), 43 ); ?>
					<span>
						<?php echo get_avatar( get_the_author_email(), 43 ); ?>
					</span>
				</a>
				<i class="line_h">
				</i>
				<h3>
					<a href="<?php the_permalink() ?>">
						<?php echo $title; ?>
					</a>
				</h3>
				<p>
					<a href="<?php echo get_author_posts_url(get_the_author_meta( 'ID' )); ?>" target="_blank">
						<?php the_author_meta('display_name'); ?>
					</a>
					/
					<?php the_category(', '); ?>
					/ <?php the_time('Y.m.d');?>
				</p>
				<a onfocus="this.blur()" class="up" href="<?php the_permalink() ?>#comments">
					<?php comments_number('0', '1', '%' );?>
				</a>
			</div>
			<!--content_banner-->
			<?php $postimg = get_post_meta($post->ID, "postimg_value", true); $postimg = trim(strip_tags($postimg)); ?>
			<div class="content_banner">
				<?php if(!empty($postimg)){ ?>
				<a href="<?php the_permalink() ?>">
					<img src="<?php echo $postimg; ?>"
					/>
				</a>
				<?php } ?>
				<div class="text">
					<?php echo $excerpt; ?>
				</div>
			</div>
			<!--toolBar-->
			<div class="toolBar">
				<ul>
					<li class="browse">
						浏览:<?php echo getPostViews(get_the_ID()); ?>
					</li>
					<li class="share" onmouseover="share_more(<?php the_ID(); ?>,this);">
						<a href="javascript:;">
							分享到...
						</a>
					</li>
				</ul>
				<a href="<?php the_permalink() ?>" class="more">
					阅读全文
				</a>
			</div>
			<script>
				postArray[<?php the_ID(); ?>] = [];
				postArray[<?php the_ID(); ?>][0] = "<?php the_title(); ?>  ";
				postArray[<?php the_ID(); ?>][1] = "<?php the_permalink() ?>";
				postArray[<?php the_ID(); ?>][2] = "　　<?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 250, "…"); ?>";
				postArray[<?php the_ID(); ?>][3] = "<?php echo $postimg; ?>";
			</script>
		</div>
		<!--content_text End-->
		<?php endwhile;?><?php endif; ?>
		<!--Page-->
		<div class="page">
			<?php par_pagenavi(9); ?>
			
			<a href="#top" class="back_top">
			</a>
		</div>
		<!--Page End-->
	</div>
	<!--Content End-->
	<?php get_sidebar(); ?>
</div>
<!--Container End-->

<?php get_footer(); ?>